package com.cycle.community.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author lenovo
 * @create 2022/8/11 17:20
 */
@Data
@Document(indexName = "discusspost",shards = 6,replicas = 3)
public class DiscussPost {

    @Id//建索引，把id存到字段上去
    private long id;
    /**
     * 用户id
     */
    @Field(type = FieldType.Long)
    private long userId;
    //互联网校招  -->  提炼关键词，存储尽可能拆多，搜索尽可能满足寻求
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")//存储解析器，搜索解析器
    private String title;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String content;
    /**
     * 0-普通; 1-置顶
     */
    @Field(type = FieldType.Integer)
    private int type;
    /**
     * 0-正常; 1-精华; 2-拉黑
     */
    @Field(type = FieldType.Integer)
    private int status;

    @Field(type = FieldType.Date)
    private Date createTime;

    @Field(type = FieldType.Integer)
    private int commentCount;

    @Field(type = FieldType.Double)
    private double score;
}
